/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package service;

import beans.User;
import java.sql.ResultSet;
import java.util.logging.Level;
import java.util.logging.Logger;
import jdbc.MyJdbc;

/**
 *
 * @author Administrator
 */
public class PersonInfoService {
    
    
    public User ReUserInfo(String id) {
        User user =null;
        String sql = "select * from student where id = ?";
        MyJdbc jdbc = new MyJdbc();
        jdbc.getConnection();
        try {
            ResultSet res = jdbc.query(sql, id);
            if(res.next()) {
                user = new User(res.getString(1), res.getString(2), res.getString(3), res.getString(4), res.getString(5), res.getString(6),
                        res.getString(7), res.getString(8), res.getString(9), res.getString(10), res.getString(11));
            }
            
            return user;
        } catch (Exception ex) {
            Logger.getLogger(PersonInfoService.class.getName()).log(Level.SEVERE, null, ex);
        }
        return user;
        
    }
}
